﻿/*
 *  Copyright 2009 Duck Pond, Inc.
 *  http://www.duckpondinc.com/
 *  
 *  This file is part of Server Watch & Alert.
 *
 *  Server Watch & Alert is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  Server Watch & Alert is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Server Watch & Alert.  If not, see <http://www.gnu.org/licenses/>.
 *  
 * */

using System;
using System.IO;
using System.Windows.Forms;
using DuckPond.ServerWatchAlert.Core;

namespace DuckPond.ServerWatchAlert.Front.WinForms
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            // load config file
            FileInfo configFile = new FileInfo("../../Data/Config.xml");
            if (!configFile.Exists)
            {
                configFile = new FileInfo("Data/Config.xml");
                if (!configFile.Exists)
                {
                    throw new FileNotFoundException("Cannot find Config.xml");
                }
            }
            MonitorManager.LoadConfig(configFile.FullName);

            // load ui
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Monitor());
        }
    }
}
